<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="db.Tob"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="db.ProjectDAO"%>
<%@page import="db.Group" %>
<%@page import="db.TobDAO" %>
<%@page import="db.UserDAO" %>
<%@page import="db.User"%>
<%@page import="db.Substore"%>
<%@page import="db.SubstoreDAO"%>
<%@ include file="/jsp/common/utility/volti.jsp" %>
<%@ include file="/jsp/common/utility/logined.jsp" %>
<%
	request.setCharacterEncoding("utf-8");
	WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	SubstoreDAO substoreDAO = (SubstoreDAO)ctx.getBean("SubstoreDAO");
	TobDAO tobDAO = (TobDAO)ctx.getBean("TobDAO");
	List sublist = substoreDAO.findAll();
	int uid = 0 ;
	if(session.getAttribute("id")!=null){
		uid = (Integer)session.getAttribute("id");
	}
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
	SimpleDateFormat codesdf = new SimpleDateFormat("yyyyMMddHHmmss");
	String rdate = sdf.format(new Date());
	UserDAO userDAO = (UserDAO)ctx.getBean("UserDAO");
	User user = userDAO.findById(uid);
	Group group = user.getGroup();
	request.setAttribute("sublist",sublist);
	request.setAttribute("toblist",tobDAO.findAll());
	request.setAttribute("groupname",group.getName());
	request.setAttribute("reCode","J" + codesdf.format(new Date()));
	request.setAttribute("rdate",rdate);
	pageContext.forward("/vm/procure/procureReceive.vm");
%>
<%!
	
%>